<template>
  <div class="header">
    <div class="nav">
      <h2>ToDoList</h2>
      <input @keydown.enter="add(value)" v-model="value" type="text" />
    </div>
    <button @click="pushbtn">兄弟传个值</button>
  </div>
</template>

<script>
import { mixin } from "../mixin";
// 引用一个混合
export default {
  data() {
    return {
      value: "",
    };
  },
  mounted() {},

  components: {},
  mixins: [mixin],
  methods: {
    pushbtn() {
      this.$bus.$emit("push", 2222);
    },
  },
};
</script>

<style lang="scss" scoped>
.header {
  width: 100%;
  height: 50px;
  background-color: rgb(59, 58, 58);
  display: flex;
  align-items: center;
  .nav {
    width: 50%;
    height: 40px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    input {
      width: 500px;
      height: 40px;
    }
  }
}
</style>
